﻿using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using TMPro;
using UnityEngine;

namespace MrPP.SerriedCabinet
{
    public class StartWindow : MonoBehaviour
    {
        [SerializeField]
        public class Data
        {
            public string url;

        }
        /*
      
        [SerializeField]
        TMP_InputField _ipInput;
        public string ip {
            get {
                return _ipInput.text;
            }
        }

        [SerializeField]
        TMP_InputField _portInput;
        public int port {
            get {
                return int.Parse(_portInput.text);
            }
        }
        const string IpKey = "#server_ip";
        const string PortKey = "#server_port";
        // Start is called before the first frame update
        void Start()
        {
        
            _ipInput.onValueChanged.AddListener(delegate (string value)
            {
        
                    PlayerPrefs.SetString(IpKey, value);
            
            });
            if (!PlayerPrefs.HasKey(IpKey))
            {
                PlayerPrefs.SetString(IpKey, "127.0.0.1");
            }
            _ipInput.text = PlayerPrefs.GetString(IpKey);


            _portInput.onValueChanged.AddListener(delegate (string value)
            {
               
                PlayerPrefs.SetInt(PortKey, int.Parse(value));
              
            });
            if (!PlayerPrefs.HasKey(PortKey))
            {
                PlayerPrefs.SetInt(PortKey, 3344);
            }
            _portInput.text = PlayerPrefs.GetInt(PortKey).ToString();



           
        }
        */

    }
}